package com.itheima.entity;

import com.baomidou.mybatisplus.annotation.*;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;

import java.io.Serializable;
import java.time.LocalDateTime;

/**
 * 用户实体
 * @author 51585
 * @TableName user
 */
@TableName(value ="user")
@Data
@ApiModel(value = "用户")
public class User implements Serializable {
    private static final long serialVersionUID = -5999867981511656267L;
    /**
     * 用户唯一标识
     */
    @ApiModelProperty(value = "用户id" ,required = true)
    @TableId
    private String id;

    /**
     * 用户名
     */
    @ApiModelProperty(value = "用户名" ,required = true)
    @TableField(value = "name")
    private String name;

    /**
     * 电话
     */
    @ApiModelProperty(value = "用户电话" ,required = true)
    @TableField(value = "phone")
    private String phone;

    /**
     * 密码
     */
    @ApiModelProperty(value = "用户密码" ,required = true)
    @TableField(value = "password")
    private String password;

    /**
     * 头像地址
     */
    @ApiModelProperty(value = "用户头像地址" )
    @TableField(value = "image_url")
    private String imageUrl;

    /**
     * 所属组织id
     */
    @ApiModelProperty(value = "组织id" ,required = true)
    @TableField(value = "organization_id")
    private Integer organizationId;

    /**
     * 创建时间
     */
    @ApiModelProperty(value = "创建时间")
    @TableField(value = "created_at", fill = FieldFill.INSERT)
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime createdAt;

    /**
     * 更新时间
     */
    @ApiModelProperty(value = "更新时间")
    @TableField(value = "updated_at", fill = FieldFill.UPDATE)
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime updatedAt;

    /**
     * 删除时间
     */
    @ApiModelProperty(value = "删除时间")
    @TableField(value = "deleted_at")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @TableLogic
    private LocalDateTime deletedAt;

}